home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / ControlStrip.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  6.2 KB  |  183 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ControlStrip.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ControlStrip;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CONTROLSTRIP__}
  27. {$SETC __CONTROLSTRIP__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ControlStripIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __MENUS__}
  40. {$I Menus.p}
  41. {$ENDC}
  42. {    Memory.p                                                    }
  43. {        MixedMode.p                                                }
  44. {    Quickdraw.p                                                    }
  45. {        QuickdrawText.p                                            }
  46. {    Events.p                                                    }
  47. {        OSUtils.p                                                }
  48.  
  49. {$IFC UNDEFINED __DIALOGS__}
  50. {$I Dialogs.p}
  51. {$ENDC}
  52. {    Errors.p                                                    }
  53. {    Windows.p                                                    }
  54. {        Controls.p                                                }
  55. {    TextEdit.p                                                    }
  56.  
  57. {$PUSH}
  58. {$ALIGN MAC68K}
  59. {$LibExport+}
  60.  
  61. CONST
  62.     sdevInitModule                = 0;                            { initialize the module}
  63.     sdevCloseModule                = 1;                            { clean up before being closed}
  64.     sdevFeatures                = 2;                            { return feature bits}
  65.     sdevGetDisplayWidth            = 3;                            { returns the width of the module's display}
  66.     sdevPeriodicTickle            = 4;                            { periodic tickle when nothing else is happening}
  67.     sdevDrawStatus                = 5;                            { update the interface in the Control Strip}
  68.     sdevMouseClick                = 6;                            { user clicked on the module's display area in the Control Strip}
  69.     sdevSaveSettings            = 7;                            { saved any changed settings in module's preferences file}
  70.     sdevShowBalloonHelp            = 8;                            { puts up a help balloon, if the module has one to display}
  71.  
  72. {********************************************************************************************
  73.  
  74.     Features supported by the module.  If a bit is set, it means that feature is supported.
  75.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  76.  
  77. ********************************************************************************************}
  78.     sdevWantMouseClicks            = 0;                            { notify the module of mouseDown events}
  79.     sdevDontAutoTrack            = 1;                            { call the module to do mouse tracking}
  80.     sdevHasCustomHelp            = 2;                            { module provides its own help messages}
  81.     sdevKeepModuleLocked        = 3;                            { module needs to be locked in the heap}
  82.  
  83. {********************************************************************************************
  84.  
  85.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  86.     If a bit is set, the module can request that a specific function is performed by
  87.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  88.     for future use by Apple, and should be set to zero.
  89.  
  90. ********************************************************************************************}
  91.     sdevResizeDisplay            = 0;                            { resize the module's display}
  92.     sdevNeedToSave                = 1;                            { need to save changed settings, when convenient}
  93.     sdevHelpStateChange            = 2;                            { need to update the help message because of a state change}
  94.     sdevCloseNow                = 3;                            { close a module because it doesn't want to stay around}
  95.  
  96. {********************************************************************************************
  97.  
  98.     miscellaneous
  99.  
  100. ********************************************************************************************}
  101.     sdevFileType                = 'sdev';
  102.  
  103.     sdevMenuItemMark            = '•';
  104.  
  105. {    direction values for SBDrawBarGraph}
  106.     BarGraphSlopeLeft            = -1;                            { max end of sloping bar graph is on the left}
  107.     BarGraphFlatRight            = 0;                            { max end of flat bar graph is on the right}
  108.     BarGraphSlopeRight            = 1;                            { max end of sloping bar graph is on the right}
  109.  
  110. {********************************************************************************************
  111.  
  112.     utility routines to provide standard interface elements and support for common functions
  113.  
  114. ********************************************************************************************}
  115.  
  116. FUNCTION SBIsControlStripVisible: BOOLEAN;
  117.     {$IFC NOT GENERATINGCFM}
  118.     INLINE $7000, $AAF2;
  119.     {$ENDC}
  120. PROCEDURE SBShowHideControlStrip(showIt: BOOLEAN);
  121.     {$IFC NOT GENERATINGCFM}
  122.     INLINE $303C, $0101, $AAF2;
  123.     {$ENDC}
  124. FUNCTION SBSafeToAccessStartupDisk: BOOLEAN;
  125.     {$IFC NOT GENERATINGCFM}
  126.     INLINE $7002, $AAF2;
  127.     {$ENDC}
  128. FUNCTION SBOpenModuleResourceFile(fileCreator: OSType): INTEGER;
  129.     {$IFC NOT GENERATINGCFM}
  130.     INLINE $303C, $0203, $AAF2;
  131.     {$ENDC}
  132. FUNCTION SBLoadPreferences(prefsResourceName: ConstStr255Param; VAR preferences: Handle): OSErr;
  133.     {$IFC NOT GENERATINGCFM}
  134.     INLINE $303C, $0404, $AAF2;
  135.     {$ENDC}
  136. FUNCTION SBSavePreferences(prefsResourceName: ConstStr255Param; preferences: Handle): OSErr;
  137.     {$IFC NOT GENERATINGCFM}
  138.     INLINE $303C, $0405, $AAF2;
  139.     {$ENDC}
  140. PROCEDURE SBGetDetachedIndString(theString: StringPtr; stringList: Handle; whichString: INTEGER);
  141.     {$IFC NOT GENERATINGCFM}
  142.     INLINE $303C, $0506, $AAF2;
  143.     {$ENDC}
  144. FUNCTION SBGetDetachIconSuite(VAR theIconSuite: Handle; theResID: INTEGER; selector: LONGINT): OSErr;
  145.     {$IFC NOT GENERATINGCFM}
  146.     INLINE $303C, $0507, $AAF2;
  147.     {$ENDC}
  148. FUNCTION SBTrackPopupMenu({CONST}VAR moduleRect: Rect; theMenu: MenuHandle): OSErr;
  149.     {$IFC NOT GENERATINGCFM}
  150.     INLINE $303C, $0408, $AAF2;
  151.     {$ENDC}
  152. FUNCTION SBTrackSlider({CONST}VAR moduleRect: Rect; ticksOnSlider: INTEGER; initialValue: INTEGER): OSErr;
  153.     {$IFC NOT GENERATINGCFM}
  154.     INLINE $303C, $0409, $AAF2;
  155.     {$ENDC}
  156. FUNCTION SBShowHelpString({CONST}VAR moduleRect: Rect; helpString: StringPtr): OSErr;
  157.     {$IFC NOT GENERATINGCFM}
  158.     INLINE $303C, $040A, $AAF2;
  159.     {$ENDC}
  160. FUNCTION SBGetBarGraphWidth(barCount: INTEGER): INTEGER;
  161.     {$IFC NOT GENERATINGCFM}
  162.     INLINE $303C, $010B, $AAF2;
  163.     {$ENDC}
  164. PROCEDURE SBDrawBarGraph(level: INTEGER; barCount: INTEGER; direction: INTEGER; barGraphTopLeft: Point);
  165.     {$IFC NOT GENERATINGCFM}
  166.     INLINE $303C, $050C, $AAF2;
  167.     {$ENDC}
  168. PROCEDURE SBModalDialogInContext(filterProc: ModalFilterUPP; VAR itemHit: INTEGER);
  169.     {$IFC NOT GENERATINGCFM}
  170.     INLINE $303C, $040D, $AAF2;
  171.     {$ENDC}
  172.  
  173. {$ALIGN RESET}
  174. {$POP}
  175.  
  176. {$SETC UsingIncludes := ControlStripIncludes}
  177.  
  178. {$ENDC} {__CONTROLSTRIP__}
  179.  
  180. {$IFC NOT UsingIncludes}
  181.  END.
  182. {$ENDC}
  183.